<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>余额充值</title>
<meta name="author" content="10023.m.jd.com">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<link rel="apple-touch-icon-precomposed" href="http://st.360buyimg.com/vm/images/apple-touch-icon.png?v=jd2015012915">
<link rel="stylesheet" type="text/css" href="../addons/feng_recharge/template/css/base2013.css?{TIMESTAMP}" charset="gbk">
<link rel="stylesheet" type="text/css" href="../addons/feng_recharge/template/css/chongzhi.css?{TIMESTAMP}" charset="gbk">
<script   src="../addons/feng_recharge/template/js/zepto.min.js" type="text/javascript"></script>
</head>
<body id="body">
<div class="new-header">
	<h2>余额充值</h2>
</div>
<div id="banner_box" class="box_swipe" style='width:100%;float:left;'>
	<ul>
		{loop $advs $adv}
		<li>
			<a href="{if empty($adv['link'])}#{else}{$adv['link']}{/if}">
				<img src="{php echo tomedia($adv['thumb']);}" title="{$adv['advname']}" style='width:100%;height: 130px;'/>
			</a>
			<span class="title">{$adv['advname']}</span>
		</li>
		{/loop}
	</ul>
	<ol>
	   {php $slideNum = 1;}
	{loop $advs $adv}
		<li{if $slideNum == 1} class="on"{/if}></li>
		{php $slideNum++;}
	{/loop}
	</ol>
</div>
<form id="chongzhi_form" action="javascript:;" method="post">
<div class="main" style="margin-top:130px;">
    <div class="recharge">
        <div class="recharge-num">
            <input type="tel" id="provider" name="isp" value="" max="11" style="width:90%" class="recharge-phone" autocomplete="off" placeholder="请输入您要充值的金额">
		</div>
        <div class="recharge-sum">
            <a class="btn-grey" id="price5" onclick="javascript:changePrice(5)">50元</a>
            <a class="btn-grey" id="price10" onclick="javascript:changePrice(10)">100元</a>
            <a class="btn-grey" id="price20" onclick="javascript:changePrice(20)">200元</a>
            <a class="btn-grey" id="price50" onclick="javascript:changePrice(50)">500元</a>
            <a class="btn-grey" id="price9" onclick="jDPrice()" style="display:none">其它金额</a>
        </div>
		<div class="p-price " id="price_type" style="padding-left: 3.125%;">
        <p id="addr" style="float:right;margin-right:10%;"></p> 
        </div>
        <div class="donation-btns"><a href="javascript:submit1();" id="buyButton" class="btn-submit-donation btn-red" value="立即充值">立即充值</a></div>
        <div class="view-record"><a href="{php echo $this->createMobileUrl('myorder')}">查看我的充值记录 &gt;</a></div>
    </div>
</div>
</form>
</body>
<script type="text/javascript">
	function changePrice(pr){
		var num = $("#provider").attr('value') / 10;
		if (num > 0) {
			$("a#price"+num).removeClass('btn-red');
			$("a#price"+num).addClass('btn-grey');
			$("a#price"+pr).removeClass('btn-grey');
			$("a#price"+pr).addClass('btn-red');
			$("#provider").val(pr*10);
		}else{
			$("a#price"+pr).removeClass('btn-grey');
			$("a#price"+pr).addClass('btn-red');
			$("#provider").val(pr*10);
		}	
	}

	function submit1(){	    
    	var form_input = document.getElementById("chongzhi_form");
    	var price = form_input['provider'].value;
		if (!price) {
			alert('请选择您的充值金额！');
			return false;
		}
		
		var url="./index.php?i="+{php echo $_W['uniacid']}+"&c=entry&price="+price+"&do=ajax&m=feng_recharge&wxref=mp.weixin.qq.com#wechat_redirect";
		window.location.href=url;
    }
</script>
</html>